<div class="row-fluid">
    <div class="well">
	    <div class="btn-toolbar">
	     	<a class="btn btn-danger" href="/order/forOrder/ifm/1/keyList/1/uid/<?=I('get.uid')?>" style="position:relative;float:right;padding:3px 6px;margin-right:10px">已选清单</a>
		    <form>
		    	<label style="display: inline;">商品标题：</label><input class="input input-medium" type="text" name="goods_title" value="<?=I('get.goods_title')?>" />
		    	<input type="hidden" value="<?=I('get.res')?>" name="res" />
		    	<button class="btn btn-info" style="margin:-9px 0 0 15px"><i class="icon-search"></i> 搜索</button>
		    </form>
		</div>
		<hr>
		<table class="table">
		      <thead>
		        <tr>
		          <th style="text-align:center">-</th>
		          <th style="text-align:left">商品标题</th>
		          <th style="text-align:center">商品价格</th>
		          <th style="text-align:center">已选择</th>
		      	  <th style="text-align:center">操作</th>
		        </tr>
		      </thead>
		      <tbody>
		      	<?php if($getData){$hasChose = S('viewlist'.I('get.uid'));foreach($getData AS $key=>$val){ ?>
		        <tr> 
		          <td style="text-align:center;vertical-align:middle"><input type="checkbox" /></td>
		          <td style="text-align:left;vertical-align:middle"><?=$val['goods_title']?></td>
		          <td style="text-align:center;vertical-align:middle"><input style="width:60px" type="text" class="price" value="<?=$val['goods_price']?>" /> / <?=$val['goods_attr']?> × <input style="width:30px" type="text" class="nums" value="1" /> <?=$val['goods_attr']?></td>
		          <td style="text-align:center;vertical-align:middle">
		          	<?php if($hasChose['uid'] == I('get.uid') && isset($hasChose['list'][$val['goods_id']])){?>
		          	<span style="color:red"><?=$hasChose['list'][$val['goods_id']]['goods_price']?> 元  × <?=$hasChose['list'][$val['goods_id']]['goods_nums']?> <?=$hasChose['list'][$val['goods_id']]['goods_attr']?> = <?=$hasChose['list'][$val['goods_id']]['goods_nums']*$hasChose['list'][$val['goods_id']]['goods_price']?> 元</span>
		          	<?php }else{?>
		          		-
		          	<?php }?>
		          </td>
		          
		          <td style="text-align:center;vertical-align:middle">
		              <a class="btn btn-info putlist" href="javascript:void(0)" gid="<?=$val['goods_id']?>" stitle="<?=$val['goods_title']?>" surl="<?=$val['goods_pic']?>" attrs="<?=$val['goods_attr']?>" style="padding: 2px 5px;">加入清单</a>&nbsp;&nbsp;
		          </td>
		        </tr>
		        <?php }}else{?>
		        <tr><td style="text-align:center;vertical-align:middle" colspan=5>暂无数据</td></tr>
		        <?php }?>
		      </tbody>
		   </table>
	</div>
</div>
<script>
$(function(){
	$('.putlist').click(function(){
		$.post('/order/forOrder',{'putViewList':'1','gid':$(this).attr('gid'),'uid':'<?=I('get.uid')?>','nums':$(this).parents('tr').find('.nums').val(),'title':$(this).attr('stitle'),'surl':$(this).attr('surl'),'attrs':$(this).attr('attrs'),'price':$(this).parents('tr').find('.price').val()},function(data){
			location.reload();
		},'json');
	});
	$('.sureBtn').click(function(){
		var list = window.parent.art.dialog.list;
		list['SETCHOSEID'].close();
	});
})
</script>